import time
from yuekao1013.Base.Base import Base
from selenium.webdriver.common.by import By

class Page(Base):
    query_loc = (By.ID,'query')
    def query(self):
        self.send_keys(self.query_loc,'软件测试自动化')

    stb_loc = (By.ID,'stb')
    def stb(self):
        self.click(self.stb_loc)

    sogou_next = (By.ID,'sogou_next')
    def sougou(self):
        self.click(self.sogou_next)

    def luoji_sougou_01(self):
        self.open_url('https://www.sogou.com/')
        print(self.driver.title)
        time.sleep(1)
        self.query()
        self.stb()
        time.sleep(1)
        assert '测试' == self.driver.title
        assert '软件测试' == self.driver.title
        time.sleep(1)
        self.sougou()
        assert '测试' == self.driver.title
        assert '软件测试' == self.driver.title
        time.sleep(10)